export class Service {

    constructor() { 
        if (new.target === Service) {
            throw new Error('Cannot construct Service instances directly')
        }
    }

    success = (data, msg = 'success') => {
        return {
            code: 200,
            data,
            msg,
            isOk: true
        }
    }
    error = (code = 500, msg = 'error') => {
        return {
            code,
            msg,
            data: null,
            isOk: false
        }
    }
}